package sessionBeans;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NamedQuery;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import sessionBeans.Interfaces.IGestContactRemote;

import entityBeans.Contact;
import entityBeans.ContactGroup;

/**
 * Session Bean implementation class GestionContactBean
 */
@Stateless(mappedName = "GestContactEntity")
public class GestContact extends GestCrud<Contact> implements IGestContactRemote {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Default constructor.
	 */
	public GestContact() {
		// TODO Auto-generated constructor stub
		super(Contact.class);
	}
	
	public Set<Contact> findAll() {
		// TODO Auto-generated method stub
		Query q = em.createQuery("FROM Contact");
		return new HashSet<Contact>(q.getResultList());
	}
}
